package com.hankol.community.adapter

import android.widget.ImageView
import com.baselibrary.extension.checkValue
import com.baselibrary.extension.load
import com.baselibrary.utils.NumberUtils
import com.baselibrary.utils.TimeUtil
import com.baselibrary.view.RoundCornerImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.R
import com.hankol.community.bean.ForumListBean


/**某个分类下 的 讲坛  分页列表
 *@author:hanke
 *2022/3/30
 *desc:
 */
class ForumClassifyListAdapter : BaseQuickAdapter<ForumListBean, BaseViewHolder>(R.layout.item_forum_classify) {

    override fun convert(helper: BaseViewHolder, item: ForumListBean) {
        helper.getView<ImageView>(R.id.riv_cover).load(mContext, item.cover.checkValue())
        helper.setText(R.id.tv_title, item.title.checkValue()).setText(R.id.tv_title_sub, item.desc.checkValue())
                .setText(R.id.tv_time_play_num, "${TimeUtil.fromToday(item.lastTime)}  ${NumberUtils.formatBigNum("${item.allWatchNum}")}播放")
                .setText(R.id.tv_course_num, "共${item.courseNum}讲")
    }
}